Description: fix typos and spelling errors
Author: Gürkan Myczko <gurkan@phys.ethz.ch>
Author: Fabio Augusto De Muzio Tobich <ftobich@gmail.com>
Forwarded: no
Last-Update: 2020-11-08

Index: dhex/README.txt
===================================================================
--- dhex.orig/README.txt
+++ dhex/README.txt
@@ -110,9 +110,9 @@ read from it, -r can be used. For exampl
 sets the cursor to 0xaffe, and searches for the hex string "d0 0f" backwards 
 from there.
 
-% ./dhex -oh affe -shb d00f -w occurances.log dhex 
+% ./dhex -oh affe -shb d00f -w occurrences.log dhex 
 
-writes the results into a logfile called "occurances.log" and exits.
+writes the results into a logfile called "occurrences.log" and exits.
 
 -----------------------------------------------------------------[ 5. Hexcalc ]-
 
Index: dhex/datatypes.h
===================================================================
--- dhex.orig/datatypes.h
+++ dhex/datatypes.h
@@ -101,7 +101,7 @@ typedef	struct	_tSearch
 	tBool	forwardnotbackward;
 	char	searchstring[32];
 	tInt16	searchlen;
-	tInt64	occurancesfound;
+	tInt64	occurrencesfound;
 	tInt64	lastoccurance;
 	tInt64	lastsearchlogpos;
 } tSearch;
Index: dhex/dhex.1
===================================================================
--- dhex.orig/dhex.1
+++ dhex/dhex.1
@@ -101,7 +101,7 @@
 .Ek
 .Sh DESCRIPTION
 .Nm
-is a hex editor. It can be used to alter individual bytes in large files. Since it is a text-mode programm based on ncurses, it can run in numerous scenarios.
+is a hex editor. It can be used to alter individual bytes in large files. Since it is a text-mode program based on ncurses, it can run in numerous scenarios.
 .
 Its special feature is the diff mode: With it, the user has a visual tool for file comparison. This mode is invoked when 
 .Nm
@@ -155,7 +155,7 @@ from an exotic terminal.
 .It Fl m Ar markerfile
 It is possible in 
 .Nm
-to set bookmarks and store them in a markerfile for later use. With this parameter, the markerfile is being read at start time, making it unnecesarry to read them later through the gui. Their file format is described in 
+to set bookmarks and store them in a markerfile for later use. With this parameter, the markerfile is being read at start time, making it unnecessary to read them later through the gui. Their file format is described in 
 .Xr dhex_markers 5 .
 .It Fl ob od oh oo Ar offset
 After loading a file, the cursor is set to 0, and the first page of bytes is being shown on the screen. With one of those parameters it is possible to start at any other location in the file. The cursorposition could be given as a binary number with
@@ -179,11 +179,11 @@ or an octal one with
 .Pp
 This way, the first few bytes in a file can be skipped, and just the rest can be compared.
 .It Fl r Ar searchlog
-When searching from the command line, the offsets are being read from this searchlog. Its format is being decribed in
+When searching from the command line, the offsets are being read from this searchlog. Its format is being described in
 .Xr dhex_searchlog 5 .
 .It Fl r1 Ar searchlog1
 .It Fl r2 Ar searchlog2
-When searching in two files simultanously, the offsets can be read from two different searchlogs.
+When searching in two files simultaneously, the offsets can be read from two different searchlogs.
 .It Fl sa sab sh shb Ar string
 Instead of setting the cursor offset to an absolute value, it is possible to search for a specific string from the command line. If there is an additional 
 .Op Fl ob od oh oo Ar offset
@@ -202,7 +202,7 @@ or
 can be applied.
 .It Fl s1a s1ab s1h s1hb Ar string1
 .It Fl s2a s2ab s2h s2hb Ar string2
-In the diff mode, it is possible to search for two strings in two files simultanously.
+In the diff mode, it is possible to search for two strings in two files simultaneously.
 .It Fl v
 Prints out the version of
 .Nm . 
@@ -212,7 +212,7 @@ When searching from the command line, wr
 .Pp
 .It Fl \&w1 Ar searchlog1
 .It Fl w2 Ar searchlog2
-When searching in two files simultanously, write the results from both searches into those log files.
+When searching in two files simultaneously, write the results from both searches into those log files.
 .El
 .Sh USER INTERFACE
 .Ss General
@@ -235,11 +235,11 @@ If no other
 .Op Fl o 
 or 
 .Op Fl a
-parameter was given at start time, the cursor is being set to offset 0. It is also being shown in the hex column. Here, it can be moved with the cursor keys. When entering a hexadecimal number, the file is being edited. The file can be edited in the ascii column as well, simply by pressing the TAB key (or whichever key was substituted for it in the keyboard setup). Pressing TAB again will return the cursor to the hex column. Pressing F9 (or its substitute) will undo the last of the changes. Changes are being shown in a differnt color. 
+parameter was given at start time, the cursor is being set to offset 0. It is also being shown in the hex column. Here, it can be moved with the cursor keys. When entering a hexadecimal number, the file is being edited. The file can be edited in the ascii column as well, simply by pressing the TAB key (or whichever key was substituted for it in the keyboard setup). Pressing TAB again will return the cursor to the hex column. Pressing F9 (or its substitute) will undo the last of the changes. Changes are being shown in a different color. 
 .Pp
 Editing is not possible in the diff mode. Here, pressing the cursor keys will move both files synchronously.
 .Ss The goto screen
-Pressing F1 (or its substitute) will open the Goto... screen. Here, it is possible to jump to a specific address directly, without the need of scrolling there with the cursor keys. The address can be entered in the 'To' field, either absolute or relative (to leap over a specified amount of bytes). An absolute address is being chosen by pressing '=', and a relative one by pressing '+' or '-', for a positive or negative leap respectively. Regardless of the adressing mode, it has to be entered as a hexadecimal number.
+Pressing F1 (or its substitute) will open the Goto... screen. Here, it is possible to jump to a specific address directly, without the need of scrolling there with the cursor keys. The address can be entered in the 'To' field, either absolute or relative (to leap over a specified amount of bytes). An absolute address is being chosen by pressing '=', and a relative one by pressing '+' or '-', for a positive or negative leap respectively. Regardless of the addressing mode, it has to be entered as a hexadecimal number.
 .Pp
 It is also possible to set up to ten bookmarks in this screen: Pressing '0'...'9' will select one of them. Moving the cursor to "Set" and pressing ENTER will alter one of those book marks. The "Diff:" fields are showing the difference between the actual cursor position and the bookmark.
 .Pp
@@ -249,11 +249,11 @@ parameter.
 .Xr dhex_markers 5
 describes the format of the marker files.
 .Ss Searching
-Pressing F2 (or its subsitute) will open the Search... screen. Here, a short string can be entered (either in hex, or in ascii). If no logfiles are being selected, the cursor will jump to the next occurance of this search string upon selection of "Go". It can be chosen if the search is supposed to be conducted forward of backwards.
+Pressing F2 (or its substitute) will open the Search... screen. Here, a short string can be entered (either in hex, or in ascii). If no logfiles are being selected, the cursor will jump to the next occurrence of this search string upon selection of "Go". It can be chosen if the search is supposed to be conducted forward of backwards.
 .Pp
-To jump to the next occurance, F3 (or its substitute) has to be pressed. To jump to the previous one, F4 has to be pressed. The search itself wraps at the edges of the file, meaning that when it reaches the end, it will start from the beginning and vice versa.
+To jump to the next occurrence, F3 (or its substitute) has to be pressed. To jump to the previous one, F4 has to be pressed. The search itself wraps at the edges of the file, meaning that when it reaches the end, it will start from the beginning and vice versa.
 .Pp
-Searchlogs are an advanced way of searching: Writing to the searchlog does not jump the cursor from one occurance to the next. Instead, it will write the offsets of all of them into the logfile. Their format is described in
+Searchlogs are an advanced way of searching: Writing to the searchlog does not jump the cursor from one occurrence to the next. Instead, it will write the offsets of all of them into the logfile. Their format is described in
 .Xr dhex_searchlog 5 .
 .Pp
 Reading from this searchlog means that the search does not cover the whole file: Only the addresses which have been provided in this file are being searched. Thus it is possible to search for specific changes. Like for example the number of lives stored in the save file of a game. 
Index: dhex/main.c
===================================================================
--- dhex.orig/main.c
+++ dhex/main.c
@@ -67,7 +67,7 @@ void helpscreen(char* argv0,int exitval)
 	fprintf(stderr," -sa, -SA, -sab, -SAB [x]     find the ascii string x in file (b=backwards)\n");
 	fprintf(stderr," -sh, -SH, -shb, -SHB [x]     find the hex string x in file (b=backwards)\n");
 	fprintf(stderr," -r, -R [read searchlog]      read the search positions from this searchlog\n");
-	fprintf(stderr," -w, -W [write searchlog]     write the location of the occurances to this log\n");
+	fprintf(stderr," -w, -W [write searchlog]     write the location of the occurrences to this log\n");
 	fprintf(stderr,"\n");
 	fprintf(stderr,"%s [Parameters] [Filename1] [Filename2]: Diff mode\n",argv0);
 	fprintf(stderr," -cd, -CD [x]                      correlate with the minimum difference\n");
@@ -688,7 +688,7 @@ int main(int argc,char** argv)
 							cursorpos2=actcursorpos2;
 						}
 					} 
-					else if (search1.occurancesfound)
+					else if (search1.occurrencesfound)
 					{
 						searchfor(&search1,buf1,&cursorpos1,(ch==KEYF3));	// f3: next
 						firstpos1=cursorpos1;
@@ -762,8 +762,8 @@ int main(int argc,char** argv)
 		if (markers)	free(markers);
 		welcomescreen(argv[0]);
 	} else {
-		if (gosearch1) fprintf(stderr,"%lli occurances found in %s\n",search1.occurancesfound,buf1->filename);
-		if (gosearch2) fprintf(stderr,"%lli occurances found in %s\n",search2.occurancesfound,buf2->filename);
+		if (gosearch1) fprintf(stderr,"%lli occurrences found in %s\n",search1.occurrencesfound,buf1->filename);
+		if (gosearch2) fprintf(stderr,"%lli occurrences found in %s\n",search2.occurrencesfound,buf2->filename);
 	}
 	return 0;
 }
Index: dhex/search.c
===================================================================
--- dhex.orig/search.c
+++ dhex/search.c
@@ -123,7 +123,7 @@ tInt8	searchfor(tSearch* search,tBuffer*
 		else found=0;
 		if (found)
 		{
-			search->occurancesfound++;
+			search->occurrencesfound++;
 			search->lastoccurance=actcursorpos;
 			if (search->writesearchlog)	fprintf(fwlog,"%016llx\n",(tUInt64)actcursorpos+buf->baseaddr); else done=1;
 		}
Index: dhex/ui.c
===================================================================
--- dhex.orig/ui.c
+++ dhex/ui.c
@@ -100,7 +100,7 @@ void searchmask(tOutput* output,tSearch*
 			{
 				drawcenterframe(output,14,60,"Found");
 				setcolor(output,COLOR_TEXT);
-				mvwprintw(output->win,offsy+13,offsx+1,"%lld occurances found",search->occurancesfound);
+				mvwprintw(output->win,offsy+13,offsx+1,"%lld occurrences found",search->occurrencesfound);
 				getkey((tKeyTab*)output->pKeyTab,1);
 			}
 		}
